package com.dqx.opengl_es_demo.camera;

import android.os.Bundle;

import com.dqx.opengl_es_demo.BaseActivity;
import com.dqx.opengl_es_demo.R;

/**
 * 相机预览
 */
public class CameraActivity extends BaseActivity implements BaseActivity.OnPermissionsListener {
    CameraGLSurfaceView surfaceView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_camera);
        surfaceView = findViewById(R.id.surface_view);

        //请求相机和文档读写权限
        requestPermissions(this);
    }

    /**
     * 权限请求成功
     */
    @Override
    public void onSuccess() {

    }

    /**
     * 权限请求失败
     */
    @Override
    public void onFailure() {
        finish();
    }

    @Override
    protected void onResume() {
        super.onResume();
        surfaceView.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        surfaceView.onPause();
    }
}
